#include <iostream>
using std::cout;
using std::endl;

class A{
public:
    virtual void a(){ cout << "A::a()" << endl; } 
    virtual void b(){ cout << "A::b()" << endl; } 
    virtual void c(){ cout << "A::c()" << endl; } 
};

class B{
public:
    virtual void a(){ cout << "B::a()" << endl; } 
    virtual void b(){ cout << "B::b()" << endl; } 
    void c(){ cout << "B::c()" << endl; } 
    void d(){ cout << "B::d()" << endl; } 
};

class C
: public A
, public B
{
public:
    virtual void a(){ cout << "C::a()" << endl; } 
    void c(){ cout << "C::c()" << endl; } 
    void d(){ cout << "C::d()" << endl; } 
};

void test0(){
    C c;
    c.a(); //C::a()  隐藏
    /* c.b(); //成员名访问冲突二义性 */
    c.c(); //C::c() 隐藏
    c.d(); //C::d() 隐藏 d对于C类而言是普通成员函数

    cout << endl;
    A* pa = &c;
    pa->a();//C::a() 动态多态
    pa->b();//A::b() 没有覆盖,会通过虚函数表
    pa->c();//C::c() 动态多态
    /* pa->d();//A类没有定义d函数，无法调用 */
}

int main(void){
    test0();
    return 0;
}
